<?php

/**
 * Auth
 */
class Auth
{

    public function __construct()
    {
        $m = 'Article';
        $a = 'add';

        $user_id = 5;

        $sql = "select * from role,module,action where \
            role.user_id = {$user_id} and \
            role.action_id = action.id and \
            action.module_id = module.id and \
            module.name = {$m} and \
            action.name = {$a}";

        // 如果查询出数据,则说明该用户拥有权限.
    }
}
